<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>补充信息</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="insTypInfo_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        
        <div class="fieldBox col_100">
            <div class="label">邮寄时间</div>
            <div class="field">
            	<input name="mailingDt" id="mailingDt" type="text" isShow="iscar" class="ui-datepicker"
                        value="${CapPayInfoAddMessageVO.mailingDts}" validate="{required:true}">
                 <span class="requiredSymbol" isShow="iscar">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">邮寄单号</div>
            <div class="field">
                <input name="mailNumber" id="mailNumber" type="text" class="ui-textbox" 
                		value="${CapPayInfoAddMessageVO.mailNumber}" validate="{required:true}" >
               <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">接收人姓名</div>
            <div class="field">
                <input name="accepterNm" id="accepterNm" type="text" value="${CapPayInfoAddMessageVO.accepterNm}"
                	class="ui-textbox" validate="{required:true}" >
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <!-- data-value="${insTypVO.isDefVi}" -->
        <div class="fieldBox col_100">
            <div class="label">备用钥匙是否收回</div>
            <div class="field">
                <select name="standbyKey" id="standbyKey" validate="{required:true,select:true}">
                    <option value=" " selected="selected">请选择</option>
					<c:forEach items="${yesOrNOList }" var="kv">
						<option value="${kv.key }">${kv.value }</option>
					</c:forEach>
                </select>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">备注</div>
            <div class="field" style="width: 100%;">
            	<textarea name="remark" id="remark" rows="4" class="ui-textarea l-textarea" style="width:80%" value="" validate="" >${CapPayInfoAddMessageVO.remark}</textarea>
            </div>
        </div>
    </div>
	<div class="btnsBox">
		<input name="payPassOpinionId" id="payPassOpinionId" type="hidden" value="${CapPayInfoAddMessageVO.id}">
	</div>
    <div class="btnsBox">
        <span id="saveInsTypInfo_Btn" class="sq-button sq-button-round">保存</span>
    </div>
</form>
<script>
    $(function () {
    	
        var capPayInfoId = "${capPayInfoId}";
        var id = "${CapPayInfoAddMessageVO.id}";

        $("#typClsCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        $("#typPid").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        $("#insTypInfo_form").ligerForm({
            validate: true
        });
        initData();
        var _url = null;
        if (id == " "){
        	_url = '<%=path%>/capital/capPayInfo/mwssageAdd.do?capPayInfoId='+capPayInfoId
        }else {
			_url = '<%=path%>/capital/capPayInfo/mwssageAdd.do?capPayInfoId='+capPayInfoId+'&&id='+id
		}
        
        /*保存*/
        $("#saveInsTypInfo_Btn").click(function (event) {
            var form = liger.get("insTypInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
    function initData(){
    	var payPassOpinionId = $("#payPassOpinionId").val();
    	if(StringUtils.isEmpty(payPassOpinionId)) return;
    	var form = liger.get("insTypInfo_form");
    	form.setData({
    		standbyKey:'${CapPayInfoAddMessageVO.standbyKey}'
    	});
    }
</script>
</body>
</html>
